﻿package com.jdplat.jdm.core.web.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.ModelAndView;

import com.jdplat.jdm.web.service.system.ISystemLogService;

/**
 * 
 * ClassName: SystemLogInterceptor <br/> 
 * Function: 系统访问日志记录. <br/> 
 * Reason: TODO ADD REASON(可选). <br/> 
 * date: 2016年12月14日 上午11:31:13 <br/> 
 * 
 * @author qirp 
 * @version  
 * @since JDK 1.6
 */
public class SystemLogInterceptor extends BaseInterceptor{
	
	@Autowired
	private ISystemLogService systemLogService;
	
	private Long beginTime;//进入时间
	private Long endTime;//结束时间
	
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		beginTime = System.currentTimeMillis();
		return true;
	}

	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {
	}

	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
			throws Exception {
	}
}
